package assets {
	import business.CurrencyCodes;

	import flash.utils.Dictionary;

	public final class GraphicResources {
		private static var _icons:Object = null;

		private static function get icons():Object {
			if (_icons == null) {
				initializeIcons();
			}
			return _icons;
		}

		private static function initializeIcons():void {
			_icons = new Object();
			_icons[CurrencyCodes.USD] = icon_usd;
			_icons[CurrencyCodes.GBP] = icon_gbp;
			_icons[CurrencyCodes.EUR] = icon_eur;
		}

		[Embed(source="home.png")]
		public static const home:Class;

		[Embed(source="spinner.gif")]
		public static const spinner:Class;

		[Embed(source="currency_list.png")]
		public static const currencyList:Class;

		[Embed(source="unknown.png")]
		private static const icon_unknown:Class;

		[Embed(source="USD.png")]
		private static const icon_usd:Class;

		[Embed(source="GBP.png")]
		private static const icon_gbp:Class;

		[Embed(source="EUR.png")]
		private static const icon_eur:Class;

		public static function getIconFromCurrencyCode(currencyCode:String):Class {
			var icon:Class = icons[currencyCode] as Class;
			if (icon == null) {
				icon = icon_unknown;
			}
			return icon;
		}
	}
}